package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.StatisticsDoctorPatientDetail;


/**
 * <p>
 * 医生关联患者统计数据
 * </p>
 *
 * @author xiao
 * @since 2022-06-14
 */
@Data
@TableName("dtrd_rl_statistics_doctor_patient")
public class DtrdRlStatisticsDoctorPatient {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 统计日期
     */
    @TableField("record_date")
    private Date recordDate;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 是否删除  1 是 0 否
     */
    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 医生ID
     */
    @TableField("doctor_id")
    private Integer doctorId;

    /**
     * 机构编码
     */
    @TableField("org_code")
    private String orgCode;

    /**
     * 今日测量次数
     */
    @TableField("measure_num")
    private Integer measureNum;

    /**
     * 当天扫码患者数量
     */
    @TableField("scan_count")
    private Integer scanCount;

    /**
     * 未测量患者数
     */
    @TableField("un_measure_patient_num")
    private Integer unMeasurePatientNum;

    /**
     * 重点关注患者数
     */
    @TableField("concern_num")
    private Integer concernNum;

    public DtrdRlStatisticsDoctorPatient init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdRlStatisticsDoctorPatient parseFromDto(StatisticsDoctorPatientDetail dto) {
        dataId = dto.getDataId();
        recordDate = dto.getRecordDate();
        doctorId = dto.getDoctorId();
        orgCode = dto.getOrgCode();
        measureNum = dto.getMeasureNum();
        scanCount = dto.getScanCount();
        unMeasurePatientNum = dto.getUnMeasurePatientNum();
        concernNum = dto.getConcernNum();
        return this;
    }


}
